package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.HotMarketDTO;
import com.yuanfeng.business.dto.ShopClassInfoDTO;
import com.yuanfeng.business.dto.ShopClassQueryDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShopClassController
 * @Description
 * @Author hyq
 * @Date 2023/7/7 10:58
 * @Version 1.0
 **/
@RestController
@RequestMapping("shop/class")
public class ShopClassController extends BaseController {

    /**
     * 店铺分类更新或新增
     *
     * @param param
     * @return
     */
    @PostMapping("/platform/update")
    public ResponseResult updateShopClass(@RequestBody ShopClassInfoDTO param) {
        ResponseResult result = shopClassService.updateShopClass(param);
        return result;
    }

    /**
     * 店铺分类删除
     *
     * @param param
     * @return
     */
    @PostMapping("/platform/delete")
    public ResponseResult deleteShopClass(@RequestBody ShopClassQueryDTO param) {
        ResponseResult result = shopClassService.deleteShopClass(param);
        return result;
    }


    /**
     * 查询店铺分类详情
     *
     * @param param
     * @return
     */
    @PostMapping("/platform/queryDetail")
    public ResponseResult queryShopClassDetail(@RequestBody ShopClassInfoDTO param) {
        ResponseResult result = shopClassService.queryShopClassDetail(param);
        return result;
    }

    /**
     * 爆品绑定商品列表
     * @param hotMarketRequest
     * @return
     */
    @PostMapping("/h5/queryHotGoodsList")
    public ResponseResult queryHotGoodsList(@RequestBody HotMarketDTO hotMarketRequest){
        return shopClassService.queryHotGoodsList(hotMarketRequest);
    }

}
